The Java team has tried to confuse us on version numbers. Fortunately, later versions names/numbers are a bit more logical (e.g. Java 11 is version number 11).
Java Versions
Name, Number
Java 7
1.7
Java 8
1.8 or 8
Java 9
9
Java 10
10
Java 11
11
Java 12
12
For fun/interest only -- here is a snippet of an example Java configuration (for tool called Maven):